home *** CD-ROM | disk | FTP | other *** search
- /*
- * Copyright (C) 1993, 1994, Silicon Graphics, Inc.
- * All Rights Reserved.
- *
- * This is UNPUBLISHED PROPRIETARY SOURCE CODE of Silicon Graphics, Inc.;
- * the contents of this file may not be disclosed to third parties, copied or
- * duplicated in any form, in whole or in part, without the prior written
- * permission of Silicon Graphics, Inc.
- *
- * RESTRICTED RIGHTS LEGEND:
- * Use, duplication or disclosure by the Government is subject to restrictions
- * as set forth in subdivision (c)(1)(ii) of the Rights in Technical Data
- * and Computer Software clause at DFARS 252.227-7013, and/or in similar or
- * successor clauses in the FAR, DOD or NASA FAR Supplement. Unpublished -
- * rights reserved under the Copyright Laws of the United States.
- */
- #include <stdio.h>
- #include <stdlib.h>
- #include <unistd.h>
- #include <math.h>
- #include <string.h>
- #include "wfmclient.h"
-
- #define MKRGB(r, g, b) ((((r)&0xff)<<0) | (((g)&0xff)<<8) | (((b)&0xff)<<16))
-
- class FColors {
- int cCnt;
- struct color {
- long icolor;
- char name[80];
- } colors[255];
-
- public:
- FColors()
- {
- cCnt = 0;
- add(0, 0, 0, "black");
- }
-
- void add(short red, short green, short blue, char *cname)
- {
- colors[cCnt].icolor = MKRGB(red, green, blue);
- strncpy(colors[cCnt].name, cname, 80);
- cCnt++;
- }
-
- long get(char *cname)
- {
- for (int i = 0; i < cCnt; i++)
- if (!strcmp(colors[i].name, cname))
- return(colors[i].icolor);
- }
- };
-
- struct Image {
- short xpos;
- short width;
- short height;
- ulong *imgBuf;
- short lastY;
- };
-
- enum credSectType { FontTypeId, ImageTypeId };
-
- class CredSection {
-
- public :
- static int credSectCnt;
- static ulong totalCredHeight;
- short xoff;
- short yoff;
- int lMargin;
- int rMargin;
- int size;
- float spacing;
- int credCnt;
- Image image[100];
- enum credSectType credType;
-
- CredSection(void) {};
- void setLMargin(int);
- void setRMargin(int);
- };
-
- class CredImage : public CredSection {
- public :
-
- CredImage(int, int, int, int, ulong *);
- };
-
-
- class CredFont : public CredSection {
- float mat[2][2];
- int credOff;
- char *credStr[80];
- char *fontFamily;
- char *fontCname;
- float fontAngle;
- int fontID;
-
- public:
-
- fmfontinfo finfo;
- char *fontJust;
- long fontColor;
-
- CredFont(char *fFamily, int fsize, long fcolor, char *fjust,
- float fangle, float fspacing);
- void addStr(char *str);
- char *getStr(int cur);
- void loadFontEnv();
- };
-
-